
#ifndef MAKEPIN_H
#define MAKEPIN_H

typedef enum
{
    S_PIN_IDLE = 0,
    S_PIN_HOMING_HZ,
    S_PIN_HOMING_RO,

    S_PIN_FETCH_UNLOCKING,
    S_PIN_FETCH_GOING_RO,
    S_PIN_FETCH_GOING_HZ,
    S_PIN_FETCH_LOCKING,
    S_PIN_FETCH_RETURNING_HZ,
    S_PIN_FETCH_RETURNING_RO,
    S_PIN_FETCH_OK,
    S_PIN_FETCH_FAILED,

    S_PIN_FILL_GOING_HZ,
    S_PIN_FILL_RDY_HZ,
    S_PIN_FILL_UNLOCKING,
    S_PIN_FILL_RETURNING,
    S_PIN_FILL_OVER,
	S_PIN_FETCH_AGAIN_RO_ONGOING,
	S_PIN_FILL_RO_FOR_NEXT,

    HOME_H,
    HOME_V,
    FNGRDY,
    CATCH,
    LIFT,
    SEAT,
//  FREE,
//  HOME,
    FAR,
    PAUSE,
    PIN,
    NEAR,
//  HOME,
    FDING,

    S_PIN_HMI_ONGOING,

} MAKEPINSTATUS;


typedef enum
{
    MOT_PIN_HZ,
    MOT_PIN_RO
} EN_MAKEPIN_MOT;

#define CNTOFMOTOR_MKPIN (MOT_PIN_RO+1)
typedef struct
{
    enum TSKID TskID;
    u32 idxOfCarrier;
    MAKEPINSTATUS mainState;
    u32 subState;
    u32 Homing_Cmd;
    u32 MotorIndex[CNTOFMOTOR_MKPIN];
    EN_MOT_HOME SlaveStatus;
    u32 Msg_Send;
    u32 Msg_Rcv;
    MESSAGE msg_Tx;
    MOTION_PARAM *mot_param;
    u32 selfTestOk;
}WorkUnit_MAKEPIN;

extern WorkUnit_MAKEPIN MacPin;
extern void Task_SendPin(void *p_arg);
#endif



